function y = cube(x)
% CUBE function
%x0=[-1.2,1,-1.2,1,....,-1.2,1];
n=length(x);
y=(x(1)-1)^2;
for i=2:n
    y=y+100*(x(i)-(x(i-1))^3)^2;
end


